import axios from './init'
import qs from 'qs'
import { order } from '@/store/order/intereface'

/**
 * @function
 * getAllOder
 */
export interface GetAllOder {
  query?:string
  pagenum:number
  pagesize:number
}

export const getAllOder = async (params:GetAllOder) => {
  const { data: res } = await axios.get('orders?' + qs.stringify(params))
  return res
}

export const modifyOrderStatus = async (params:order) => {
  const { data } = await axios.put(`orders/${params.order_id}`, {
    ...params
  })
  return data
}

export const getLogisticsInfo = async (id:number) => {
  const { data } = await axios.get(`/kuaidi/${id}`)
  return data
}
